package com.linskating.wheat.model.enums;

import lombok.Getter;

@Getter
public enum TeamStatusEnum {

    PUBLIC(0, "公开"),
    PRIVATE(1, "私有"),
    SECRET(2, "加密");


    private final int value;
    private final String text;

    TeamStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public static TeamStatusEnum getTeamStatusEnum(Integer value) {
        if (value == null) {
            return null;
        }
        TeamStatusEnum[] values = TeamStatusEnum.values();
        for (TeamStatusEnum teamStatusEnum : values) {
            if (value.equals(teamStatusEnum.getValue())) {
                return teamStatusEnum;
            }
        }
        return null;
    }
}
